﻿@*自动计算 适配移动端 查看详细页面 - 列表点击详细打开此页面*@
@*YoursLC有源低代码 Create:admin 2024-04-01 10:39:22 列表-此文件放置于Views/AutomaticCalculation /中*@

@using Think9.Models;
@{ ViewBag.Title = "MobileDetail";
    Layout = "~/Areas/Shared/_LayuiMobileForm.cshtml";}

<style type="text/css">
    .layui-table-cell {
        height: auto;
        line-height: 35px;
    }
    .layui-table{
        border: 2px solid #fff; /* 不加手机右侧总有两道线 */
    }
</style>

<form class="layui-form layui-form-pane" lay-filter="formUser">
<input style="display:none" id="_listid" value="@ViewBag.ListId">
<input style="display:none" id="_fwid" value="bi_AutomaticCalculation">
<input style="display:none" id="_userid" value="@ViewBag.UserId">
<input style="display:none" id="_isMobile" value="y">@*y为移动端*@
<input style="display:none" id="_type" value="detail">
<table class="layui-hide" id="tableId" lay-filter="tableFilter"></table>
<table class="layui-hide" id="tb_Subtable05" lay-filter="tableFilter"> </table>
</form>
<script>
	layui.use(["form", "exLayer", "element", "exUtils",  "table"], function () {
		let form = layui.form;
		let layer = layui.layer;
		let table = layui.table;
		let exLayer = layui.exLayer;
		let exUtils = layui.exUtils;
		let element = layui.element;

		let $ = layui.$;

		form.render();//更新全部表单数据

        //渲染表格，url数据接口参数；cols设置显示字段...
        let ThisTable = table.render({
            elem: "#tableId",
            url: "/_TB/GetMobileDetail" + "?fwid=" + $("#_fwid").val() + "&listid=" + $("#_listid").val() + "&isOriginal=y",
            method: "GET",
            defaultToolbar: [{ title: '关闭', layEvent: 'close', icon: 'layui-icon-close' }],
            toolbar: "#toolbarTpl",
            cols: [[
                { templet: "#mobile_list" }
            ]],
            done: function (res, curr, count) {
                if (count == -1) {
                    //layer.msg(res.msg, { icon: 5, time: 20000, btn: ['关闭'] });//显示错误
                }
                $("#pdf").attr("href", "/_TB/GetDetail?listid=" + $('#_listid').val() + "&type=pdf&fwid=bi_AutomaticCalculation");
				$("#excel").attr("href", "/_TB/GetDetail?listid=" + $('#_listid').val() + "&type=excel&fwid=bi_AutomaticCalculation");
				$("#doc").attr("href", "/_TB/GetDetail?listid=" + $('#_listid').val() + "&type=doc&fwid=bi_AutomaticCalculation");
				$("#att").attr("href", "/Com/FileManage/AttList?listid=" + $('#_listid').val() + "&fwid=bi_AutomaticCalculation" + "&userid=" + $('#_userid').val());
            }
        });
			
		//渲染表格，url数据接口参数；cols设置显示字段...
		let tb_Subtable05 = table.render({
			elem: "#tb_Subtable05",
			url: "/_TB/GetGridList?tbid=tb_Subtable05"+"&listid=" + $('#_listid').val() + "&from=" + $('#_type').val() + "&fwid=" + $('#_fwid').val()+ "&mobile=" + $('#_isMobile').val(),
			page: false,
			defaultToolbar: [],
			cols: [[
				{ field: "flag",  hide: true }
				,{ field: "v1", title: "列1", width: 180}
				,{ field: "v2", title: "列2", width: 180}
				,{ field: "v3", title: "列3", width: 180}
			]],
			done: function (res, curr, count) {
				$('.layui-table .layui-table-cell > span').css({ 'font-weight': 'bold' });
				
				if (count == -1) {
					layer.msg(res.msg, { icon: 5, time: 20000, btn: ['关闭'] });//显示错误
				}
				
			}
		
		});
        //toolbar监听事件(处理table顶部按钮)
        table.on("toolbar(tableFilter)", function (obj) {
            switch (obj.event) {
                case "close":
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                    break;
            }
        });
	});
</script>
<!-- 行工具栏模板 -->
<script type='text/html' id='mobile_list'>
	<div class='layui-tab-content'>
		<div class='layui-table-cell' style='margin-left:-25px;margin-right:-25px;overflow:visible;text-overflow:inherit;white-space:normal;'>小数01： {{d.inXS01 ==  null ? '' : d.inXS01}}</div>
		<div class='layui-table-cell' style='margin-left:-25px;margin-right:-25px;overflow:visible;text-overflow:inherit;white-space:normal;'>小数02： {{d.inXS02 ==  null ? '' : d.inXS02}}</div>
		<div class='layui-table-cell' style='margin-left:-25px;margin-right:-25px;overflow:visible;text-overflow:inherit;white-space:normal;'>小数03： {{d.inXS03 ==  null ? '' : d.inXS03}}</div>
		<div class='layui-table-cell' style='margin-left:-25px;margin-right:-25px;overflow:visible;text-overflow:inherit;white-space:normal;'>小数04： {{d.inXS04 ==  null ? '' : d.inXS04}}</div>
		<div class='layui-table-cell' style='margin-left:-25px;margin-right:-25px;overflow:visible;text-overflow:inherit;white-space:normal;'>小数05： {{d.inXS05 ==  null ? '' : d.inXS05}}</div>
		<div class='layui-table-cell' style='margin-left:-25px;margin-right:-25px;overflow:visible;text-overflow:inherit;white-space:normal;'>小数06： {{d.inXS06 ==  null ? '' : d.inXS06}}</div>
		<div class='layui-table-cell' style='margin-left:-25px;margin-right:-25px;overflow:visible;text-overflow:inherit;white-space:normal;'>小数07： {{d.inXS07 ==  null ? '' : d.inXS07}}</div>
		<div class='layui-table-cell' style='margin-left:-25px;margin-right:-25px;overflow:visible;text-overflow:inherit;white-space:normal;'>小数08： {{d.inXS08 ==  null ? '' : d.inXS08}}</div>
	</div>
</script>
<!-- 头工具栏模板 -->
<script type="text/html" id="toolbarTpl">
   <div class="layui-btn-container">
       <a href="" target="_blank" id="pdf" class="layui-btn layui-btn-primary layui-btn-sm"><i class="fa fa-file-pdf-o"></i></a>&nbsp;
       <a href="" target="_blank" id="excel" class="layui-btn layui-btn-primary layui-btn-sm"><i class="fa fa-file-excel-o"></i></a>&nbsp;
        <a href="" target="_blank" id="doc" class="layui-btn layui-btn-primary layui-btn-sm"><i class="fa fa-file-word-o"></i></a>&nbsp;
        <a href="" target="_blank" id="att" class="layui-btn layui-btn-primary layui-btn-sm"><i class="fa fa-file-o"></i></a>
  </div>
</script>

<!-- 图片显示 -->
<script>
    function PopUpImg(id) {
        showImg(id);//在global.js中定义
    }
</script>